home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part2 / 10756 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  963 b 

  1. Path: mail2news.demon.co.uk!dfdesign.demon.co.uk
  2. From: Dominic Feeley <dom@dfdesign.demon.co.uk>
  3. Newsgroups: comp.lang.c
  4. Subject: Re: operator % - compiler error
  5. Date: Tue, 19 Mar 96 19:32:41 GMT
  6. Organization: DF Designs
  7. Message-ID: <827263961snz@dfdesign.demon.co.uk>
  8. References: <4ihuuh$6ul@hatathli.csulb.edu>
  9. Reply-To: dom@dfdesign.demon.co.uk
  10. X-NNTP-Posting-Host: dfdesign.demon.co.uk
  11. X-Newsreader: Demon Internet Simple News v1.30
  12. X-Mail2News-Path: dfdesign.demon.co.uk
  13.  
  14. In article <4ihuuh$6ul@hatathli.csulb.edu> davidcho@csulb.edu "David Cho" writes:
  15.  
  16. > When I try to compile, I get an erro message for the following line:            >
  17. >
  18. > x=663608941*y%pow(2,32)  /*I want remainder*/
  19. >
  20. > But the error message says "illegal use of floating point".  What does
  21. > that mean?  Isn't % used a an operator to calcuate the remainder?
  22.  
  23. Yes, but the operands of % must be of integral type in ANSI C
  24. pow() returns a double.
  25.  
  26. Regards,
  27. Dominic.
  28.  
  29. -- 
  30. Dominic Feeley
  31.